/********************************************************************************
 * @Author: Zhenzhou Liu
 * @Date: 2025-01-11
 * @Description: 
 *******************************************************************************/
#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>

typedef struct {
    int* data;
    int size;
    int capacity;
} Stack;

Stack* createStack(int capacity) {
    Stack* stack = malloc(sizeof(Stack));
    stack->size = 0;
    stack->capacity = capacity;
    stack->data = calloc(capacity, sizeof(int));
    return stack;
}

void pushStack(Stack* stack, int x) {
    if (stack->size == stack->capacity) {
        stack->capacity *= 2;
        stack->data = realloc(stack->data, stack->capacity * sizeof(int));
    }
    stack->data[stack->size++] = x;
}

int popStack(Stack* stack) {
    return stack->data[--stack->size];
}

int topStack(Stack* stack) {
    return stack->data[stack->size - 1];
}

bool emptyStack(Stack* stack) {
    return stack->size == 0;
}

void freeStack(Stack* stack) {
    free(stack->data);
}


int getAndRemoveLastElement(Stack * stack) {
    int x = popStack(stack);
    if (emptyStack(stack))
        return x;
    int last = getAndRemoveLastElement(stack);
    pushStack(stack, x);
    return last;
}

void reverse(Stack * stack) {
    if (emptyStack(stack))
        return;
    int x = getAndRemoveLastElement(stack);
    reverse(stack);
    pushStack(stack, x);
}

int main() {
    int n, temp;
    scanf("%d", &n);
    Stack* stack = createStack(10);
    for (size_t i = 0; i < n; ++i) {
        scanf("%d", &temp);
        pushStack(stack, temp);
    }

    reverse(stack);
    for (int i = 0; i < n; ++i) {
        if (i > 0)
            printf("%c", ' ');
        printf("%d", popStack(stack));
    }
    freeStack(stack);
    free(stack);
    return 0;
}
